package com.ruoyi.chiwen.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.chiwen.mapper.TbAlsomoneyMapper;
import com.ruoyi.chiwen.domain.TbAlsomoney;
import com.ruoyi.chiwen.service.ITbAlsomoneyService;

/**
 * 还款记录Service业务层处理
 * 
 * @author chiwen
 * @date 2021-06-14
 */
@Service
public class TbAlsomoneyServiceImpl implements ITbAlsomoneyService 
{
    @Autowired
    private TbAlsomoneyMapper tbAlsomoneyMapper;

    /**
     * 查询还款记录
     * 
     * @param sId 还款记录ID
     * @return 还款记录
     */
    @Override
    public TbAlsomoney selectTbAlsomoneyById(Long sId)
    {
        return tbAlsomoneyMapper.selectTbAlsomoneyById(sId);
    }

    /**
     * 查询还款记录列表
     * 
     * @param tbAlsomoney 还款记录
     * @return 还款记录
     */
    @Override
    public List<TbAlsomoney> selectTbAlsomoneyList(TbAlsomoney tbAlsomoney)
    {
        return tbAlsomoneyMapper.selectTbAlsomoneyList(tbAlsomoney);
    }

    /**
     * 新增还款记录
     * 
     * @param tbAlsomoney 还款记录
     * @return 结果
     */
    @Override
    public int insertTbAlsomoney(TbAlsomoney tbAlsomoney)
    {
        tbAlsomoney.setCreateTime(DateUtils.getNowDate());
        return tbAlsomoneyMapper.insertTbAlsomoney(tbAlsomoney);
    }

    /**
     * 修改还款记录
     * 
     * @param tbAlsomoney 还款记录
     * @return 结果
     */
    @Override
    public int updateTbAlsomoney(TbAlsomoney tbAlsomoney)
    {
        tbAlsomoney.setUpdateTime(DateUtils.getNowDate());
        return tbAlsomoneyMapper.updateTbAlsomoney(tbAlsomoney);
    }

    /**
     * 批量删除还款记录
     * 
     * @param sIds 需要删除的还款记录ID
     * @return 结果
     */
    @Override
    public int deleteTbAlsomoneyByIds(Long[] sIds)
    {
        return tbAlsomoneyMapper.deleteTbAlsomoneyByIds(sIds);
    }

    /**
     * 删除还款记录信息
     * 
     * @param sId 还款记录ID
     * @return 结果
     */
    @Override
    public int deleteTbAlsomoneyById(Long sId)
    {
        return tbAlsomoneyMapper.deleteTbAlsomoneyById(sId);
    }
}
